package com.zhouchao.code.feign.email;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author: zhouchao
 * @Date: 2021/10/16 22:17
 * @Description:
 */
@Slf4j
@Component
public class EmailServiceFeignClientFallbackFactory implements FallbackFactory<EmailServiceFeignClient> {
    @Override
    public EmailServiceFeignClient create(Throwable throwable) {
        log.error("fallback reason:{}",throwable.getMessage());
        return new EmailServiceFallBack();
    }
}
